package org.example;

import com.github.pagehelper.PageHelper;
import org.apache.ibatis.session.SqlSession;
import org.example.domain.Student;
import org.example.domain.dao.StudentDao;
import org.example.domain.utils.MyBatisUtils;
import org.junit.Test;

import java.util.List;

public class test {
    @Test
    public void  select()
    {
        SqlSession sqlSession = MyBatisUtils.getSqlSession();
        PageHelper.startPage(1,2);
        StudentDao dao = sqlSession.getMapper(StudentDao.class);
        List<Student> students = dao.selectStudents();
        for (Student s: students
             ) {
            System.out.println(s);
        }
    }
}
